package com.xuecheng.content.controller;

import com.xuecheng.commons.model.dto.BindTeachplanMediaDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.*;
import com.xuecheng.content.service.TeachplanMediaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class TeachplanMediaController {

    @Autowired
    private TeachplanMediaService  teachplanMediaService;


    // 媒资绑定
    @PostMapping("/teachplan/media/association")
    public ResponseResult bangding(@RequestBody BindTeachplanMediaDto dto){ // 接收参数
        // 接收参数 返回结果
        return teachplanMediaService.bangding(dto);
    }

    // 媒资解绑
    @DeleteMapping("/teachplan/media/{teachPlanMediaId}")
    public ResponseResult meizijiebang(Long courseBaseId,@PathVariable("teachPlanMediaId") Long teachPlanMediaId){ //接受参数
        // 调用方法  返回结果
    return teachplanMediaService.meizijiebang(courseBaseId,teachPlanMediaId);


    }


}
